package org.fioma.tree;

import java.io.BufferedWriter;
import java.io.IOException;

public interface InternalNode<L, I extends InternalNode<L, I, F, N>, F extends LeafNode<L, I, F, N>, N extends Node<L, I, F, N>> extends Node<L, I, F, N> {
	// pointer to: parent node, each child node and Word

	public N nextNode(char letter);

	public N nextNode(byte letter);

	public N[] getChilds();

	public void setChild(N node, char letter);

	public void setChild(N node, byte letter);

	public I getOrCreateInternalNode(L word);

	public F addWord(L word);

	public void printWords(BufferedWriter bw, String prefix) throws IOException;

	// try to find out the word in the subtree rooted by this node
	public boolean find(L word);

	public I createChildInternalNode(L word);

	public F createChildLeaf(L word);

}
